<?php

/* @var $this \yii\web\View */
/* @var $content string */

use yii\helpers\Html;
use frontend\assets\AppAsset;

AppAsset::register($this);

$this->title = 'yii';

?>
<?php $this->beginPage() ?>
<!DOCTYPE html>
<html lang="<?= Yii::$app->language ?>">
<head>
    <meta charset="<?= Yii::$app->charset ?>">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <?= Html::csrfMetaTags() ?>
    <title><?= Html::encode($this->title) ?></title>
    <?php $this->head() ?>
</head>
<body>
<?php $this->beginBody() ?>

<div id="body-wrap">
    <div id="header">
        <div class="container">
            <!--
            <div class="pull-left" style="padding-top:10px;">
                <img src="/res/img/dashou_brand.png" width="40px" height="40px"/>
            </div>
            -->
            <ul class="hori-list header-nav-left pull-left" style="margin-left:0px;">
                <li><a href="/dev/site" class="selected">开发者</a></li>
            </ul>
            <ul class="hori-list header-nav-right pull-right">
                <?php
                if(Yii::$app->user->isGuest) {
                    echo '<li><a href="/home/login">登录</a></li>';
                    echo '<li><a href="/home/register">注册</a></li>';
                } else {
                    echo '<li><a href="/">' . Yii::$app->user->identity->username . '</a></li>';
                    echo '<li><a href="/home/logout">退出</a></li>';
                }
                ?>
            </ul>
        </div>
    </div>

    <div class="container" style="padding:20px 0px 80px;">
        <div class="container container-box">
            <?php
            if(Yii::$app->controller !== null) {
                echo Yii::$app->controller->renderPartial('/layouts/main_side_menu');
            }
            ?>
            <div class="side-main pull-left">
                <?= $content ?>
            </div>
        </div>
    </div>

</div>

<div id="footer">
    <div class="container">
        <p class="pull-left">&copy; 2017</p>
        <!--
        <p class="pull-right">大手</p>
        -->
    </div>
</div>

<?php $this->endBody() ?>
</body>
</html>
<?php $this->endPage() ?>
